package com.yc.test;

import com.yc.bean.UserBean;
import com.yc.dao.UserDao;

import java.util.List;
import java.util.Random;

public class testuser {
    static Random random=new Random();
    public static void main(String[] args) {


        UserDao.insert("朱小飞",randomuser(),randompwd());
        UserDao.insert("蒋小强",randomuser(),randompwd());
        UserDao.insert("陈小喵",randomuser(),randompwd());

    }
    // 生成随机用户名的方法示例
    private static String randompwd() {

        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < 8; i++) {
            sb.append((char) (random.nextInt(26) + 'a'));
        }
        return sb.toString();
    }

    // 生成随机密码的方法示例
    private static String randomuser() {

        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < 8; i++) {
            sb.append(random.nextInt(10));
        }
        return sb.toString();
    }
}
